package com.xhj.bigfactory.bigFactory.GC_JVM;
/**
 * -
 *
 * @author 周沫 @Date 2021-08-01 @Time 4:01
 */
public class HelloGC {
  public static void main(String[] args) {
    System.out.println("Hello GC!");
    //	  System.gc();
    byte[] bytes1 = new byte[1024 * 1024 * 1024];
    //	try {Thread.sleep(1000);} catch (Exception e) {e.printStackTrace();}finally{}
    new Thread(
            () -> {
              System.out.println(Thread.currentThread().getName() + ": come in...");
              byte[] bytes2 = new byte[1024 * 1024 * 1024];
            },
            "t1")
        .start();
    new Thread(
            () -> {
              System.out.println(Thread.currentThread().getName() + ": come in...");
              byte[] bytes2 = new byte[1024 * 1024 * 1024];
            },
            "t2")
        .start();
    new Thread(
            () -> {
              System.out.println(Thread.currentThread().getName() + ": come in...");
              byte[] bytes2 = new byte[1024 * 1024 * 1024];
            },
            "t3")
        .start();

    try {
      Thread.sleep(Integer.MAX_VALUE);
    } catch (Exception e) {
      e.printStackTrace();
    } finally {
    }
  }
}
